package com.liuqi.aiagent.transfer.model;

import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import java.io.Serializable;
import lombok.Getter;
import lombok.Setter;
import lombok.ToString;

/**
 * @author liuqi
 * @date 2025/7/3 16:03
 **/
@Getter
@Setter
@ToString
@ApiModel("响应结果集")
public class Result<T> implements Serializable {

    private static final long serialVersionUID = 6849794470754667711L;

    @ApiModelProperty("状态码")
    private int code;

    @ApiModelProperty("消息")
    private String msg;

    @ApiModelProperty("时间戳")
    private String timestamp;

    @ApiModelProperty("数据")
    private T data;

    public Result(int code, String msg, T data) {
        this.code = code;
        this.msg = msg;
        this.timestamp = Long.toString(System.currentTimeMillis());
        this.data = data;
    }
}
